package com.changcheng.project.yuminsi.enums;

/**
 * @author yuminsi
 * @description
 * @date 2020/8/21 10:44
 * @since
 */
public enum VehicleUseType {
    /**
     *家庭自用
     */
    HOMEUSE("家庭自用","1"),
    /**
     *非营业车辆
     */
    NONBUSINESSVEHICLE("非营业车辆","2"),
    /**
     *营业客车
     */
    BUSINESSVEHICLE("营业客车","3"),
    /**
     *非营业货车
     */
    NONBUSINESSTRUCK("非营业货车","4"),
    /**
     *营业货车
     */
    BUSINESSTRUCK("营业货车","5"),
    /**
     *特种车
     */
    SPECIALVEHICLEA("特种车","6"),
    /**
     *挂车
     */
    TRAILER("挂车","7"),
    /**
     *应急救援
     */
    EMERGENCYRESCUE("应急救援","8"),
    /**
     *集装箱车
     */
    BIGTRUCK("集装箱车","集装箱车"),
    /**
     *牵引车
     */
    TRACTOR("牵引车","A"),
    /**
     *其他牵引车
     */
    OTHERTRACTOR("其他牵引车","B");

    private String name;
    private String code;

    VehicleUseType() {
    }

    VehicleUseType(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static VehicleUseType getVehicleUseType(String code){
        for (VehicleUseType type:values()){
            if (type.getCode().equals(code)){
                return type;
            }
        }
        return null;
    }
}
